_rrrr_eeee_aaaa_dddd_dddd_iiii_rrrr______rrrr is a reentrant version of _rrrr_eeee_aaaa_dddd_dddd_iiii_rrrr. The directory entry at the
current position in _dddd_iiii_rrrr_pppp is copied into _e_n_t_r_y. The storage pointed to by
_e_n_t_r_y shall be large enough for a _d_i_r_e_n_t with an array of _c_h_a_r _d__n_a_m_e
member containing at least {_N_A_M_E__M_A_X} plus one elements. Upon successful
return, the pointer returned at *_r_e_s_u_l_t shall have the same value as the
argument _e_n_t_r_y. Upon reaching the end of the directory stream, this
pointer shall have the value _NNNN_UUUU_LLLL_LLLL.
_tttt_eeee_llll_llll_dddd_iiii_rrrr returns the current location associated with the named directory
stream.
_ssss_eeee_eeee_kkkk_dddd_iiii_rrrr sets the position of the next _rrrr_eeee_aaaa_dddd_dddd_iiii_rrrr operation on the directory
stream. The new position reverts to the position associated with the
directory stream at the time the _tttt_eeee_llll_llll_dddd_iiii_rrrr operation that provides _l_o_c was
performed. Values returned by _tttt_eeee_llll_llll_dddd_iiii_rrrr are valid only if the directory
has not changed because of compaction or expansion. This situation is
not a problem with System V, but it may be a problem with some file
system types.
_rrrr_eeee_wwww_iiii_nnnn_dddd_dddd_iiii_rrrr resets the position of the named directory stream to the
beginning of the directory. It also causes the directory stream to refer
to the current state of the corresponding directory, as a call to _oooo_pppp_eeee_nnnn_dddd_iiii_rrrr
would.
_cccc_llll_oooo_ssss_eeee_dddd_iiii_rrrr closes the named directory stream and frees the _DDDD_IIII_RRRR structure.
_rrrr_eeee_aaaa_dddd_dddd_iiii_rrrr_6666_4444, _rrrr_eeee_aaaa_dddd_dddd_iiii_rrrr_6666_4444______rrrr, _ssss_eeee_eeee_kkkk_dddd_iiii_rrrr_6666_4444, and _tttt_eeee_llll_llll_dddd_iiii_rrrr_6666_4444 are parallel interfaces
provided for cases where the information returned will not fit in the
fields in the _dddd_iiii_rrrr_eeee_nnnn_tttt structure. The fields in question are the inode
number (_d__i_n_o) and the current offset (_d__o_f_f). If it is necessary to
call the 64-bit interfaces, and they are not called, an _EEEE_OOOO_VVVV_EEEE_RRRR_FFFF_LLLL_OOOO_WWWW error
will result. The 64-bit _rrrr_eeee_aaaa_dddd_dddd_iiii_rrrr and _tttt_eeee_llll_llll_dddd_iiii_rrrr interfaces should not be
mixed with the non-64-bit interfaces in a sequence of calls.
The following errors can occur as a result of these operations.
_oooo_pppp_eeee_nnnn_dddd_iiii_rrrr returns _NNNN_UUUU_LLLL_LLLL on failure and sets _eeee_rrrr_rrrr_nnnn_oooo to one of the following
values:
_EEEE_NNNN_OOOO_TTTT_DDDD_IIII_RRRR A component of _f_i_l_e_n_a_m_e is not a directory.
_EEEE_AAAA_CCCC_CCCC_EEEE_SSSS A component of _f_i_l_e_n_a_m_e denies search permission.
_EEEE_AAAA_CCCC_CCCC_EEEE_SSSS Read permission is denied on the specified directory.
_EEEE_MMMM_FFFF_IIII_LLLL_EEEE The maximum number of file descriptors are currently
open.
_EEEE_NNNN_FFFF_IIII_LLLL_EEEE The system file table is full.
_EEEE_FFFF_AAAA_UUUU_LLLL_TTTT _f_i_l_e_n_a_m_e points outside the allocated address space.
_EEEE_LLLL_OOOO_OOOO_PPPP Too many symbolic links were encountered in
translating _f_i_l_e_n_a_m_e.
_EEEE_NNNN_AAAA_MMMM_EEEE_TTTT_OOOO_OOOO_LLLL_OOOO_NNNN_GGGG The length of the _f_i_l_e_n_a_m_e argument exceeds
_{{{{_PPPP_AAAA_TTTT_HHHH______MMMM_AAAA_XXXX_}}}}, or the length of a _f_i_l_e_n_a_m_e component
exceeds _{{{{_NNNN_AAAA_MMMM_EEEE______MMMM_AAAA_XXXX_}}}} while _{{{{______PPPP_OOOO_SSSS_IIII_XXXX______NNNN_OOOO______TTTT_RRRR_UUUU_NNNN_CCCC_}}}} is in
effect.
_EEEE_NNNN_OOOO_EEEE_NNNN_TTTT A component of _f_i_l_e_n_a_m_e does not exist or is a null
pathname.
_rrrr_eeee_aaaa_dddd_dddd_iiii_rrrr returns _NNNN_UUUU_LLLL_LLLL on failure and sets _eeee_rrrr_rrrr_nnnn_oooo to one of the following
values:
_EEEE_NNNN_OOOO_EEEE_NNNN_TTTT The current file pointer for the directory is not
located at a valid entry.
_EEEE_BBBB_AAAA_DDDD_FFFF The file descriptor determined by the _DDDD_IIII_RRRR stream is
no longer valid. This result occurs if the _DDDD_IIII_RRRR
stream has been closed.
_EEEE_DDDD_IIII_RRRR_CCCC_OOOO_RRRR_RRRR_UUUU_PPPP_TTTT_EEEE_DDDD The directory is corrupted on disk.
_EEEE_OOOO_VVVV_EEEE_RRRR_FFFF_LLLL_OOOO_WWWW One of the inode number values or offset values did
not fit in 32 bits, and the 64-bit interfaces were
not used.
_EEEE_IIII_NNNN_VVVV_AAAA_LLLL 64-bit and non-64-bit calls were mixed in a sequence
of calls.
_rrrr_eeee_aaaa_dddd_dddd_iiii_rrrr______rrrr returns 0 on success and an error value (see above values for
_rrrr_eeee_aaaa_dddd_dddd_iiii_rrrr) on error.
_tttt_eeee_llll_llll_dddd_iiii_rrrr, _ssss_eeee_eeee_kkkk_dddd_iiii_rrrr, and _cccc_llll_oooo_ssss_eeee_dddd_iiii_rrrr return -1 on failure and set _eeee_rrrr_rrrr_nnnn_oooo to the
following value:
_EEEE_BBBB_AAAA_DDDD_FFFF The file descriptor determined by the _DDDD_IIII_RRRR stream is
no longer valid. This results if the _DDDD_IIII_RRRR stream has
been closed.
_EEEE_IIII_NNNN_VVVV_AAAA_LLLL 64-bit and non-64-bit calls were mixed in a sequence
of calls.
EEEEXXXXAAAAMMMMPPPPLLLLEEEE
Here is a sample program that prints the names of all the files in the